<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:rich="http://richfaces.org/rich">

	<h:panelGroup>
		<table width="100%">
			<tbody>
				<tr>
					<td>
					<h2><h:outputText value="#{messages['appName']} - #{messages['fullAppName']} (BETA)" /></h2>
					</td>
					<td align="right"><h:outputLink target="_blank"
						value="http://www.ip.hn">#{messages['header.institucion']}</h:outputLink>&#160;
					<h:outputLink
						value="#">#{messages['header.guiausuario']}</h:outputLink>&#160;
					<h:outputLink
						value="#">#{messages['header.soporte']}</h:outputLink>
					</td>
				</tr>
				<tr>
					<td>
						<h:messages id="messages" globalOnly="true" styleClass="message"
							errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg"
							rendered="#{showGlobalMessages != 'false'}">
						</h:messages>
					</td>
					<td align="right">
						<!-- Rendered if the user is *not* logged in and the page is not login.xhtml -->
						<h:panelGroup rendered="#{not identity.loggedIn and view.viewId != '/login.xhtml'}">
							<h:form id="headerLoginForm">
								<h:outputLabel for="username">#{messages['login.username']}</h:outputLabel>
								<h:inputText id="username" value="#{credentials.username}"  size="10"/>
								<h:outputLabel for="password">#{messages['login.password']}</h:outputLabel>
								<h:inputSecret id="password" value="#{credentials.password}" size="10" />
								<h:outputLabel for="rememberMe">#{messages['login.recuerdame']}</h:outputLabel>
								<h:selectBooleanCheckbox id="rememberMe" value="#{rememberMe.enabled}" />
	
								<ui:remove>
								<s:link id="menuLoginId" view="/login.xhtml" value="#{messages['header.login']}" propagation="end" />
								</ui:remove>
								<h:commandButton id="submit" value="#{messages['login.login']}" action="#{identity.login}" />
							</h:form>
						</h:panelGroup>
						<!-- ========== -->
						
						<!-- Rendered if the user is logged in -->
						<h:panelGroup rendered="#{identity.loggedIn}">
							<h:outputText id="menuWelcomeId"
							value="#{messages['header.username']}: #{credentials.username}"
							rendered="#{identity.loggedIn}" />
							
							<s:link	id="menuLogoutId" action="#{identity.logout}"
							value="#{messages['header.logout']}" includePageParams="false"
							propagation="end"/>
						</h:panelGroup>
						<!-- ========== -->
					</td>
				</tr>
			</tbody>
		</table>
	</h:panelGroup>

</ui:composition>
